#@homejs() 
<div style="width:1020px;min-height:600px;"> 
	<!--标的列表-->
	<div align="left" style="padding:10px 20px 20px 0;;width:1020px;height:auto;background:#FFF;">
		<div style="line-height:50px;font-size:14px;height:auto;">
			<div align="left" style=" width:1020px;border-bottom:1px dashed #e0e0e0;height:50px;background:#fafafa">
				<div style="float:left;width:320px;margin-left:20px;">加入者</div>
				<div style="float:left;width:340px;">加入金额</div>
				<div style="float:left;width:340px;">加入时间</div>
			</div>
			<div id="rewardlist">
				
			</div>
		</div>
		<!--分页--> 
		<div align="center" style="font-size:14px;height:50px;width:100%;padding-bottom:10px;background:#FFF;line-height:50px;">
			共<span id="joinNumber"></span>位用户加入&nbsp;&nbsp;（只显示前十名）
		</div> 
	</div>
</div>
<script id="demo" type="text/x-jquery-tmpl">
	<div align="left" style="border-bottom:1px dashed #e0e0e0;height:50px;">
		<div class="onellipsis" style="float:left;margin-left:20px;width:320px;color:#fa4357">${mobile}</div>
		<div class="onellipsis" style="float:left;width:340px;">￥${amount}</div>
		<div class="onellipsis" style="float:left;width:340px;">${create_time}</div>
	</div>
</script>
<script>
	var id = GetRequest()["id"];
	//上一页
	$("#backpage").click(function(){
		page = page-1;
		if(page <= 0){
			layer.msg("当前已是首页！",{icon:2,time:1000}); 
		}else{
			$("#rewardlist").empty();
			mytradelist(coupontype,types,page,day_limit,createTimeStart,createTimeEnd);
		}
	}); 
	//下一页
	$("#nextpage").click(function(){
		page = page + 1;
		if(page > totalPage){
			layer.msg("当前已是尾页！",{icon:2,time:1000}); 
		}else{
			$("#rewardlist").empty();
			mytradelist(coupontype,types,page,day_limit,createTimeStart,createTimeEnd);
		}
	}); 

	$.getJSON("#(path)/bid/info?token=#(session.token??)&id="+id, function(bidactive) { 
		console.log(bidactive);
		var joinNumber = 0;
		$.each(bidactive.data.trades, function(i, item){ 
			console.log(item);  
			joinNumber++;
			if(i<10){
				var invests = {mobile:item.mobile,amount:item.amount,create_time:item.create_time};
				$("#demo").tmpl(invests).appendTo('#rewardlist');
			}
		});
		$("#joinNumber").html(joinNumber);
	});

</script>
